package com.vhall.component.dao.interactive;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vhall.component.entity.interactive.DocumentStatusEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author lsl
 * @since 2021/6/11 10:34
 */
@Mapper
@Repository
public interface DocumentStatusMapper extends BaseMapper<DocumentStatusEntity> {

    /**
     * 查询文档是否存在
     *
     * @param ilId      房间id
     * @param startTime 初始时间
     * @param endTime   结束时间
     * @return 是否存在值
     */
    @Select("select count(id) from document_status where il_id=#{ilId} and created_at>=#{startTime} and  created_at<=#{endTime}")
    int exist(@Param("ilId") String ilId, @Param("startTime") String startTime, @Param("endTime") String endTime);

}
